<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:useBean id="salary" class="com.kamikaze.Salary" scope="session" />
<%
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy年MM月");
java.text.SimpleDateFormat sdf2 = new java.text.SimpleDateFormat("MM月");
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.set(java.util.Calendar.MONTH, cal.get(java.util.Calendar.MONTH ) - 1);
%>
<form action="newsalary">
員工編號：<input type="text" name="user_id" value="0001" />
<input type="submit" value="查詢" />
</form>
<%=sdf.format(cal.getTime()) %>薪資
<hr>
<table>
<tr><td>員工編號：</td><td>${salary.user_id }</td><td></td></tr>
<tr><td>員工姓名：</td><td>${salary.user_name}</td><td>君</td></tr>
<tr><td>基本薪資：</td><td>${salary.user_salary }</td><td>元</td></tr>
<tr><td><%=sdf2.format(cal.getTime()) %>薪資：</td><td>${salary.total_salary }</td><td>元</td></tr>
<tr><td>病假時數：</td><td>${salary.sick_leave }</td><td>小時</td></tr>
<tr><td>事假時數：</td><td>${salary.casual_leave }</td><td>小時</td></tr>
<tr><td>公假時數：</td><td>${salary.public_leave }</td><td>小時</td></tr>
</table>